/*
 * @Descripttion: Map+双向链表
 * @Author: ziwei
 * @Date: 2022-08-30 10:42:41
 * @LastEditors: ziwei
 * @LastEditTime: 2022-08-30 10:52:51
 */
//链表
class ListNode{
    constructor(key,value,next,pre){
        this.key = key ||''
        this.value = value||''
        this.next = next || null
        this.pre = pre || null
    }
}

//map+双向链表
var LRUCache = function(capacity){
    this.map = new Map()
    this.capacity = capacity
    //哨兵模式:先创建自己-》互相指向
    this.dummyHead = new ListNode()
    this.dummyTail = new ListNode()
    this.dummyHead.next = this.dummyHead
    this.dummyTail.pre = this.dummyHead
}

//头部添加
LRUCache.prototype.addToHead = function(){

}

//移动到头部
LRUCache.prototype.moveToHead = function(){

}

//删除尾节点
LRUCache.prototype.popTail = function(){

}

//获取值
LRUCache.prototype.get = function(key){
    if(this.map.has(key)){

    }
}

//加入链表
LRUCache.prototype.put = function(key,value){

}


